<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('修改配置信息')}" />
</head>
<body class="hold-transition">
<div class="container-fluid mt-2 mb-2">
    <div class="card card-primary card-outline card-outline-tabs mb-0">
        <div class="card-header p-0 border-bottom-0">
            <ul class="nav nav-tabs">
                <li class="nav-item">
                    <a class="nav-link active" href="/profile/edit.html?type=serviceSwitch">功能开关</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/profile/edit.html?type=register">注册开关</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/profile/edit.html?type=invite">分销配置</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/profile/edit.html?type=baiJiaYun">百家云</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/profile/edit.html?type=tencentCloud">腾讯云</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/profile/edit.html?type=aliyun">阿里云</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/profile/edit.html?type=genseeLive">展示互动直播</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/profile/edit.html?type=sensitiveWords">敏感词</a>
                </li>
            </ul>
        </div>
        <div class="card-body">
            <form class="form-horizontal m" id="form-profile-edit">
                <input id="modelType"  th:value="${modelType}" type="hidden"/>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-sm-right">SSO统一认证</label>
                    <div class="col-sm-2">
                        <select name="sso" id="sso"  class="form-control m-b" th:with="type=${@dict.getType('qdx_switch_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                        <span class="text-red">合伙人多域名情况下启用</span>
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-primary" onclick="editProfile('sso')">修改配置</a>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-sm-right">微信登录</label>
                    <div class="col-sm-2">
                        <select name="wxLogin" id="wxLogin"  class="form-control m-b" th:with="type=${@dict.getType('qdx_switch_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-primary" onclick="editProfile('wxLogin')">修改配置</a>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-sm-right">支付宝支付</label>
                    <div class="col-sm-2">
                        <select name="alipay" id="alipay"  class="form-control m-b" th:with="type=${@dict.getType('qdx_switch_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-primary" onclick="editProfile('alipay')">修改配置</a>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-sm-right">微信支付</label>
                    <div class="col-sm-2">
                        <select name="wxpay" id="wxpay" class="form-control m-b" th:with="type=${@dict.getType('qdx_switch_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                    <div class="col-sm-2">
                        <a class="btn btn-primary" onclick="editProfile('wxPay')">修改配置</a>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-sm-right">优惠券</label>
                    <div class="col-sm-2">
                        <select name="coupon" id="coupon" class="form-control m-b" th:with="type=${@dict.getType('qdx_switch_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-sm-right">课程卡</label>
                    <div class="col-sm-2">
                        <select name="courseCard" id="courseCard"  class="form-control m-b" th:with="type=${@dict.getType('qdx_switch_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-sm-right">直播</label>
                    <div class="col-sm-2">
                        <select name="live" id="live" class="form-control m-b" th:with="type=${@dict.getType('qdx_switch_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-sm-right">套餐</label>
                    <div class="col-sm-2">
                        <select name="packageSwitch" id="packageSwitch" class="form-control m-b" th:with="type=${@dict.getType('qdx_switch_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-sm-right">会员</label>
                    <div class="col-sm-2">
                        <select name="member" id="member" class="form-control m-b" th:with="type=${@dict.getType('qdx_switch_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-sm-right">账户提现</label>
                    <div class="col-sm-2">
                        <select name="allowDraw" id="allowDraw" class="form-control m-b" th:with="type=${@dict.getType('qdx_switch_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                    <div class="col-sm-8 form-control-static">
                        <span class="text-red">（账户返现金额是否允许提现到银行卡）</span>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label text-sm-right">充值卡</label>
                    <div class="col-sm-2">
                        <select name="recharge" id="recharge" class="form-control m-b" th:with="type=${@dict.getType('qdx_switch_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2"></label>
                    <div class="col-sm-6">
                        <button type="button" class="btn btn-primary" onclick="profileSave()"><i class="fa fa-check"></i>保 存</button>&nbsp;
                        <button type="button" class="btn btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<th:block th:insert="~{include :: footer}" />
<script src="/static/js/profile.js"></script>
<script type="text/javascript">
    $(function () {
        $("#sso").val("[[${websiteProfile.get('sso')}]]");
        $("#wxLogin").val("[[${websiteProfile.get('wxLogin')}]]");
        $("#coupon").val("[[${websiteProfile.get('coupon')}]]");
        $("#alipay").val("[[${websiteProfile.get('alipay')}]]");
        $("#wxpay").val("[[${websiteProfile.get('wxpay')}]]");
        $("#courseCard").val("[[${websiteProfile.get('courseCard')}]]");
        $("#live").val("[[${websiteProfile.get('live')}]]");
        $("#packageSwitch").val("[[${websiteProfile.get('packageSwitch')}]]");
        $("#member").val("[[${websiteProfile.get('member')}]]");
        $("#allowDraw").val("[[${websiteProfile.get('allowDraw')}]]");
        $("#recharge").val("[[${websiteProfile.get('recharge')}]]");
    })

    function editProfile(type) {
        layer.open({
            type: 2,
            area: ['800px', '505px'],
            fix: false,
            maxmin: true,
            shade: 0.3,
            title: "修改配置",
            content: "/profile/edit.html?type=" + type
        });
    }

</script>
</body>
</html>